﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FluentNHibernate.Conventions;

namespace Landscape.Business.FNH
{
    public class CascadeAll:IHasOneConvention, IHasManyConvention, IReferenceConvention
    {
        public bool Accept(FluentNHibernate.Conventions.Instances.IManyToOneInstance instance)
        {
            return true;
        }

        public void Apply(FluentNHibernate.Conventions.Instances.IManyToOneInstance instance)
        {
            instance.Cascade.All();
        }

        public bool Accept(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance)
        {
            return true;
        }

        public void Apply(FluentNHibernate.Conventions.Instances.IOneToManyCollectionInstance instance)
        {
            instance.Cascade.All();
        }

        public bool Accept(FluentNHibernate.Conventions.Instances.IOneToOneInstance instance)
        {
            return true;
        }

        public void Apply(FluentNHibernate.Conventions.Instances.IOneToOneInstance instance)
        {
            instance.Cascade.All();
        }
    }
}
